// http://code.google.com/p/objx/wiki/select

OAction("select", {

	action: ONew,

	all: function(decider){
	
		if (ODebug) {
			if (!decider) {
				OError(".select requires a decider function as the first argument.  Remember the behaviour modifier as the second argument.  Try .select(function(){}, ONew)");
			}
		}
	
		var selected = [];
		
		this.each(function(o){
		
			if (OCheck(o, decider)) {
				selected.push(o);
			}

		});
		
		return selected;
	
	}

});

OProvides("objx.select");

OAction("reject", {
	action: ONew,
	all: function(decider){
		
		if (ODebug) {
			if (!decider) {
				OError(".reject requires a decider function as the first argument.  Remember the behaviour modifier as the second argument.  Try .reject(function(){}, ONew)");
			}
		}
	
		var selected = [];
		
		this.each(function(o){
		
			if (!OCheck(o, decider)) {
				selected.push(o);
			}
	
		});
		
		return selected;

	}
});

OProvides("objx.reject");